package com.drg.center.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.drg.center.entity.DictDrgPO;
import com.drg.center.mapper.DictDrgMapper;
import com.guaike.core.mybatis.plugins.BaseDAO;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class DictDrgDAO extends BaseDAO<DictDrgMapper, DictDrgPO> {


    public List<DictDrgPO> searchDRG(String search) {
        LambdaQueryWrapper<DictDrgPO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.like(DictDrgPO::getDrgCode, search)
                .or().like(DictDrgPO::getDrgName, search);
        return getBaseMapper().selectList(queryWrapper);
    }
}
